from datetime import datetime
from pydantic import BaseModel
from typing import Optional

class SignApplyInfoCreate(BaseModel):
    username: str
    password: str
    activityId: str
    activityName: Optional[str] = None
    nickName: Optional[str] = None
    signType: int  # 1是签到 2是签退
    signTime: Optional[datetime]  # 签到时间，单位分钟
    createAt: Optional[datetime] = None
    remark: Optional[str] = None
    isApply: Optional[int] = None
    isSuccess: Optional[int] = None


class SignApplyInfoUpdate(BaseModel):
    username: Optional[str] = None
    password: Optional[str] = None
    activityId: Optional[str] = None
    activityName: Optional[str] = None
    signType: Optional[int] = None
    signTime: Optional[int] = None
    isApply: Optional[int] = None
    remark: Optional[str] = None
    isSuccess: Optional[int] = None
    isDelete: Optional[int] = None

class SignApplyInfoResponse(BaseModel):
    id: int
    username: Optional[str]
    activityId: Optional[str]
    activityName: Optional[str]
    signType: Optional[int]
    signTime: Optional[int]
    createAt: Optional[datetime]
    isApply: Optional[int]
    remark: Optional[str]
    isSuccess: Optional[int]
    isDelete: Optional[int]

    class Config:
        from_attributes = True